Skip to content

Conversation

@adambezecny
Copy link

the fact that log string checked by extractDuration function starts with curly bracket character does not mean this string is valid json. Because of this it is better to test via new function isValidJSON introduced in this PR.

The motivation behind this pull request is that we have seen executor lambda failures while testing our lambda. When investigating what is going on we found out the log captured by extractDurationFromJSON i not valid json that could be processed by current logic. See my comments and sample log data on issue 261.

using new json validation in this case enforces parsing by extractDurationFromText, not by extractDurationFromJSON which works in this case.

@alexcasalboni
Copy link
Owner

@adambezecny thanks for opening this PR!

Unfortunately, the JSON case is actually multi-line JSON (so the JSON.parse check wouldn't work).

Anyway, the good news is that this issue was properly addressed in #268 :)

Closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants